package com.carebuddy.petcare.biz;

import com.carebuddy.petcare.controller.PetcareController;
import com.carebuddy.petcare.controller.UserController;
import com.carebuddy.petcare.dao.PetcareDAO;
import com.carebuddy.petcare.dao.UserDAO;

public class Carebuddy {
	static private UserController userController;
	static private UserBiz userBiz;
	static private UserDAO userDAO;
	
	static private PetcareController petcareController;
	static private PetcareBiz petcareBiz;
	static private PetcareDAO petcareDAO;
	// private PetcareBiz = new PetcareBiz();
	
	static public UserController getUserController() {
		if ( userController == null ) {
			userController = new UserController();
			userBiz = new UserBiz();
			userDAO = new UserDAO();
			
			userController.setUserBiz(userBiz);
			userBiz.setUserDAO(userDAO);
		}
		return userController;
	}
	
	static public PetcareController getPetcareController(){
		if( petcareController == null){
			petcareController = new PetcareController();
			petcareBiz = new PetcareBiz();
			petcareDAO = new PetcareDAO();
			
			petcareController.setPetcareBiz(petcareBiz);
			petcareBiz.setPetcareDAO(petcareDAO);
		}
		return petcareController;
	}
}
